#include <iostream>
#include <cmath>

using namespace std;

long long x;

long long  ret = 9223372036854775807;

int main()
{
    long long j = 0;
    cin >> x;
    for (int i = 1; i <= 1000000; i++)
    {
        auto sub = pow(i, 2);
        auto _min = abs(x - sub);
        if (_min < ret)
        {
            ret = _min;
            j = sub;
        }
    }
    cout << j;
    return 0;
}